import { getAllProductTypesApi } from "@/api/productInfo";
import { useProductTypeStore } from "@/stores"
export default function () {

  // 获取所有商品分类的方法
  const getAllTypes = async () => {
      try {
        const res = await getAllProductTypesApi()
        useProductTypeStore().typeList = res.data
      } catch (error) {
        console.error(error)
      }
  }

  return {
    getAllTypes
  }
}
